int rob(int *nums,int numsSize){    //打家劫舍的函数（leetcode198）
    int first,second,t;
    first = nums[0],second = nums[1];
    for(int i=2;i<numsSize;i++){
        t = second;
        second = fmax(second,first+nums[i]);
        first = t;
    }
    return second;
}
int deleteAndEarn(int* nums, int numsSize) {
    int m=0;
    for(int i = 0;i < numsSize;i++){
        m = fmax(m,nums[i]);
    }
    int sums[m+1];
    memset(sums,0,sizeof(sums));
    for(int i = 0;i < numsSize;i++){
        sums[nums[i]] += nums[i];
    }
    return rob(sums,m+1);
}